﻿using System;
using System.Collections.Generic;
using System.Data;
using PPI.General;
using PPI.WebConsumer.PPI.Svc;

namespace PPI.WebConsumer
{
    public class WVendor_Visit_XMissionStructure
    {
        public static DataSet GetServerVisits()
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DVendor_Visit_XMissionStructure_GetServerVisits(reader.ConectionMode); 
        }

        public static DataSet GetServerVisitsByUtilityID(int utilityID)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();

            return svc.DVendor_Visit_XMissionStructure_GetServerVisitsByUtilityID(utilityID, reader.ConectionMode);

        }

        public static DataSet GetServerVisitsByID(int visitId)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DVendor_Visit_XMissionStructure_GetServerVisitsById(visitId, reader.ConectionMode);

        }

        public static Int32 Save(Int32 id, Int32 projectId, Int32 utilityId, Int32 visitTypeId, Int32 topTypeId, double latitude, double longitude, double altitude, Int32 satelliteCount, DateTime satelliteTime, bool solutionAvailable, Int32 handheldId, Int32 contactId, DateTime date, int totalImages)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DVendor_Visit_XMissionStructure_Save(id,projectId,utilityId,visitTypeId,topTypeId,latitude,longitude,altitude,satelliteCount,satelliteTime,solutionAvailable,handheldId,contactId,date,totalImages,reader.ConectionMode);
        }

        public static void  Delete(Int32 id)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            svc.DVendor_Visit_XMissionStructure_Delete(id,reader.ConectionMode);
        }
    }
}
